package cn.itcast.test;

import ch.qos.logback.core.net.SyslogOutputStream;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: LDeng
 * @Date: 2021-06-23 11:56
 */
public class testHashCode {


    public static void main(String[] args) {
        Student s=new Student("zs",10);
        Student s1=new Student("zs",10);
        System.out.println(s.hashCode()+"------10");
        System.out.println(s1.hashCode());
        System.out.println(s==s1);
        s.setAge(11);
        System.out.println(s.hashCode()+"------18");
        s.setAge(10);
        System.out.println(s.hashCode()+"------10");
    }
}

@Data
@NoArgsConstructor
@AllArgsConstructor
class Student{
    String name;
    int age;
}
